package com.cqut.forum.action;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cqut.forum.service.ModuleService;

/**
 * 基础信息controller
 * @author Administrator
 *
 */
@Controller
public class SimpleAction {
	
	@Resource
	private ModuleService moduleService;
	
	@RequestMapping("/module/module_infos")
	@ResponseBody
	public List<Map<String, Object>> moduleInfo(HttpServletRequest request){
		//User user = (User)request.getSession().getAttribute("user");
		List<Map<String, Object>> result = moduleService.loadModuleInfos();
		return result;
	}
	
	@RequestMapping("/module/module_info")
	@ResponseBody
	public Map<String, Object> moduleInfo(String moduleName){
		Map<String, Object> info = moduleService.loadModuleInfo(moduleName);
		return info;
	}
}
